package com.montran.read.resources;

import java.io.InputStream;
import java.util.Properties;

import com.exceptions.ResourcesException;

public class UtilPropertyFiles {
	private static final String PROP_FILE = "data.properties";

	/* code to use values read from the file */
	public static String readPropertiesFile(String key)
			throws ResourcesException {
		try {
			InputStream is = UtilPropertyFiles.class
					.getResourceAsStream(PROP_FILE);
			Properties prop = new Properties();
			prop.load(is);
			String value = prop.getProperty(key);
			is.close();
			return value;

		} catch (Exception e) {
			throw new ResourcesException(e);
		}
		
	}
}
